
import { Component, MeshRenderer, _decorator, primitives, utils } from 'cc';

const { ccclass, property } = _decorator;


@ccclass('MyMesh')
export class MyMesh extends Component {
    start() {
        const renderer = this.node.getComponent(MeshRenderer);
        if (!renderer) {
            return;
        }
        const plane: primitives.IGeometry = primitives.plane({
            width: 10,
            length: 10,
            widthSegments: 20,
            lengthSegments: 20,
        });
        // console.log("renderer mesh :: ", renderer.mesh, utils.createMesh(plane))

        renderer.mesh = utils.createMesh(plane);
    }

}
